From 38da479ee8378c17947cbad802aef8f169364590 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Thu, 20 Feb 2020 16:02:20 +0800 Subject: [PATCH] slider: Calculate handle position in whole pixel units `-slider-handle-radius` is a floating point value and even in the default theme it's not a whole number. Regardless of the fractional part that's still going to occupy a whole extra pixel with antialiasing. So make room for it. Otherwise it looks clipped, which it is by the Cairo context of its `StDrawingArea`. Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1569 --- js/ui/slider.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/ui/slider.js b/js/ui/slider.js index 824cf8755..01b29e1fc 100644 --- a/js/ui/slider.js +++ b/js/ui/slider.js @@ -43,7 +43,9 @@ var Slider = GObject.registerClass({ let [hasHandleColor, handleBorderColor] = themeNode.lookup_color('-slider-handle-border-color', false); - let handleX = handleRadius + (width - 2 * handleRadius) * this._value / this._maxValue; + let wholeHandleRadius = Math.ceil(handleRadius); + let handleX = wholeHandleRadius + + (width - 2 * wholeHandleRadius) * this._value / this._maxValue; let handleY = height / 2; let color = themeNode.get_foreground_color(); -- 2.39.5